package com.cynteka.cyfoman.core;

/**
 * User: ukman
 * Date: 15.07.2011
 * Time: 14:14:07
 */
public class RefItem<T_ID, T_VALUE> {
    public final T_ID id;
    public final T_VALUE value;

    public RefItem(T_ID id, T_VALUE value) {
        this.id = id;
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RefItem refItem = (RefItem) o;

        if (id != null ? !id.equals(refItem.id) : refItem.id != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }
}
